import { Controller, Get, Param } from '@nestjs/common';
import { Book1Dto } from '../dto/book1.dto';
import { Book1Service } from '../service/book1.service';

@Controller('books')
export class Book1Controller {
  constructor(private readonly bookService: Book1Service) {}

  @Get()
  findAll(): Book1Dto[] {
    return this.bookService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string): Book1Dto | string {
    return this.bookService.findOne(parseInt(id, 10));
  }
}